﻿namespace NET
{
    public abstract class AbsJsonToString
    {
        public override string ToString()
        {
            LitJson.JsonWriter writer = new LitJson.JsonWriter();
            writer.PrettyPrint = true;
            LitJson.JsonMapper.ToJson(this, writer);
            return writer.ToString();
        }
    }

    /// <summary>
    /// 网络消息数据包体基类
    /// </summary>

    public sealed class WebSocketBody : AbsJsonToString
    {
        public int err_code;
        public string err_msg;
        public string data;
    }

    /// <summary>
    /// 客户端网络封包基类
    /// </summary>
    public abstract class AbsWebBodyC_S : AbsJsonToString
    {
    }

    /// <summary>
    /// 服务器回包基类
    /// </summary>
    public abstract class AbsWebBodyS_C : AbsJsonToString
    {
    }
}